home *** CD-ROM | disk | FTP | other *** search
/ Merciful 5 / Merciful - Disc 5.iso / software / p / pcqpascalv1.2d.lha / Include / Diskfont / DiskFont.i next >
Text File  |  1997-05-07  |  4KB  |  138 lines

  1. {
  2.         DiskFont.i for PCQ Pascal
  3.  
  4.         diskfont library definitions
  5. }
  6.  
  7. {$I   "Include:Exec/Nodes.i"}
  8. {$I   "Include:Exec/Lists.i"}
  9. {$I   "Include:Graphics/Text.i"}
  10. {$I   "Include:Diskfont/DiskFontBaseVar.i"}
  11.  
  12. Const
  13.  
  14.     MAXFONTPATH         = 256;   { including null terminator }
  15.  
  16. Type
  17.  
  18.     FontContents = record
  19.         fc_FileName     : Array [0..MAXFONTPATH-1] of Char;
  20.         fc_YSize        : Short;
  21.         fc_Style        : Byte;
  22.         fc_Flags        : Byte;
  23.     end;
  24.     FontContentsPtr = ^FontContents;
  25.  
  26.    TFontContents = Record
  27.     tfc_FileName  : Array[0..MAXFONTPATH-3] of Char;
  28.     tfc_TagCount  : Short;       { including the TAG_DONE tag }
  29.     {
  30.      *  if tfc_TagCount is non-zero, tfc_FileName is overlayed with
  31.      *  Text Tags starting at:  (struct TagItem *)
  32.      *      &tfc_FileName[MAXFONTPATH-(tfc_TagCount*sizeof(struct TagItem))]
  33.      }
  34.     tfc_YSize     : Short;
  35.     tfc_Style,
  36.     tfc_Flags     : Byte;
  37.    END;
  38.    TFontContentsPtr =^TFontContents;
  39.  
  40.  
  41. Const
  42.  
  43.     FCH_ID              = $0f00;
  44.     TFCH_ID             = $0f02;  { FontContentsHeader, THEN TFontContents }
  45.     OFCH_ID             = $0f03;  { FontContentsHeader, then TFontContents,
  46.                                     associated with outline font }
  47.  
  48.  
  49. Type
  50.  
  51.     FontContentsHeader = record
  52.         fch_FileID      : Short;        { FCH_ID }
  53.         fch_NumEntries  : Short;        { the number of FontContents elements }
  54.         fch_FC          : Array [0..0] of FontContents;
  55.                                         { actual number of elements is NumEntries }
  56.     end;
  57.     FontContentsHeaderPtr = ^FontContentsHeader;
  58.  
  59. Const
  60.  
  61.     DFH_ID              = $0f80;
  62.     MAXFONTNAME         = 32;   { font name including ".font\0" }
  63.  
  64. Type
  65.  
  66.     DiskFontHeader = record
  67.     { the following 8 bytes are not actually considered a part of the }
  68.     { DiskFontHeader, but immediately preceed it. The NextSegment is  }
  69.     { supplied by the linker/loader, and the ReturnCode is the code   }
  70.     { at the beginning of the font in case someone runs it...          }
  71.     {    ULONG dfh_NextSegment;{ actually a BPTR }
  72.     {    ULONG dfh_ReturnCode;   { MOVEQ #0,D0 : RTS }
  73.     { here then is the official start of the DiskFontHeader...       }
  74.         dfh_DF          : Node;         { node to link disk fonts }
  75.         dfh_FileID      : Short;        { DFH_ID }
  76.         dfh_Revision    : Short;        { the font revision }
  77.         dfh_Segment     : Integer;      { the segment address when loaded }
  78.         dfh_Name        : Array [0..MAXFONTNAME-1] of Char;
  79.                                         { the font name (null terminated) }
  80.         dfh_TF          : TextFont;     { loaded TextFont structure }
  81.     end;
  82.     DiskFontHeaderPtr = ^DiskFontHeader;
  83.  
  84. Const
  85.  
  86.     AFB_MEMORY          = 0;
  87.     AFF_MEMORY          = 1;
  88.     AFB_DISK            = 1;
  89.     AFF_DISK            = 2;
  90.     AFB_SCALED          = 2;
  91.     AFF_SCALED          = $0004;
  92.     AFB_BITMAP          = 3;
  93.     AFF_BITMAP          = $0008;
  94.     AFB_TAGGED          = 16;      { return TAvailFonts }
  95.     AFF_TAGGED          = $10000;
  96.  
  97.  
  98. Type
  99.  
  100.     AvailFont = record
  101.         af_Type         : Short;        { MEMORY or DISK }
  102.         af_Attr         : TextAttr;     { text attributes for font }
  103.     end;
  104.     AvailFontPtr = ^AvailFont;
  105.  
  106.     TAvailFonts = Record
  107.         taf_Type        : Short;           { MEMORY, DISK, OR SCALED }
  108.         taf_Attr        : TTextAttr;       { text attributes for font }
  109.     END;
  110.     TAvailFontsPtr = ^TAvailFonts;
  111.  
  112.     AvailFontsHeader = record
  113.         afh_NumEntries  : Short;        { number of AvailFonts elements }
  114.         afh_AF          : Array [0..0] of AvailFont;
  115.                                         { actual number in NumEntries }
  116.     end;
  117.     AvailFontsHeaderPtr = ^AvailFontsHeader;
  118.  
  119.  
  120.  
  121. FUNCTION AvailFonts(buffer : Address;
  122.                     bufBytes : Integer; types : Integer) : Integer;
  123.     External;
  124.  
  125. Procedure DisposeFontContents(FCH : FontContentsHeaderPtr);
  126.     External; { version 34 }
  127.  
  128. Function NewFontContents(fontsLock : Address { Lock };
  129.                         fontName : String) : FontContentsHeaderPtr;
  130.     External; { version 34 }
  131.  
  132. FUNCTION NewScaledDiskFont(srcFont : TextFontPtr; destTextAttr : TTextAttrPtr) : DiskFontHeaderPtr;
  133.     External;
  134.  
  135. Function OpenDiskFont(TA : TextAttrPtr) : TextFontPtr;
  136.     External;
  137.  
  138.